package pl.edu.agh.ssm.monitor;

import java.io.IOException;

import pl.edu.agh.ssm.monitor.data.RTSPPacketType;
import pl.edu.agh.ssm.monitor.listeners.RTPSessionListener;
import pl.edu.agh.ssm.monitor.net.PacketFilter;
import pl.edu.agh.ssm.monitor.net.PacketReceiver;
import jpcap.JpcapCaptor;
import jpcap.NetworkInterface;

public class SimpleCLStarter {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		for( NetworkInterface iFace : JpcapCaptor.getDeviceList()) {
			System.out.println(iFace.datalink_description + iFace.datalink_name + " "
					+ iFace.name + " "  + iFace.description);
		}
		try {
			PacketReceiver recv = new PacketReceiver(JpcapCaptor.getDeviceList()[1], false);
			recv.addPacketListener(new RTPSessionListener(recv), new PacketFilter(5007, null));
			recv.startReceive();
		} catch (IOException e) {
			e.printStackTrace();
		}
		System.out.println(RTSPPacketType.valueOf("DESCRIBE").toString());
		
		System.out.println(RTSPPacketType.valueOf("sample_data").toString());
		
	}

}
